﻿{include file="public/header" /}
<form method="post">
	<div class="panel admin-panel">
		<div class="panel-head"><strong>{:lang('currency')['list']}</strong></div>
		<div class="padding border-bottom">
			<script>
			//city 参数和回调
			var gid="{:input('get.gid')}";
			var cid="{:input('get.cid')}";
			var selectc=true;
			var selecta=false;
			function select_g(){
				location.href="{:url('/admin/article')}?gid="+gid;
			}
			function select_c(){
				location.href="{:url('/admin/article')}?gid="+gid+"&cid="+cid;
			}
			</script>
			<input type="button" class="button button-small checkall" name="checkall" checkfor="id" value="{:lang('currency')['all_select']}" />
			<a type="button" class="button button-small border-green" href="article/edit.html" />{:lang('currency')['add']}</a>
			<a id="select_del" type="button" class="button button-small border-red" href="#" />{:lang('currency')['del']}</a>
			---{include file="public/category" /}
			<a type="button" class="button button-small border-green editcat" href="#" />{:lang('currency')['edit']}{:lang('label')['category']}</a>
		</div>
		<table class="table table-hover">
			<tr>
				<th width="60">{:lang('label')['select']}</th>
				<th width="120">{:lang('label')['category']}</th>
				<th width="120">{:lang('label')['title']}</th>
				<th width="200">{:lang('label')['time']}</th>
				<th width="100">{:lang('label')['handle']}</th>
			</tr>
			{volist name="data" id="article"}
			<tr>
				<td >
					<input type="checkbox" name="id" value="{$article.id}" />
				</td>
				<td style="line-height:40px">{$article.title}</td>
				<td style="line-height:40px">{$article.title}</td>
				<td style="line-height:40px">{$article.time|date="y-m-d",###}</td>
				<td style="line-height:40px"><a class="button border-blue button-little" href="article/edit.html?id={$article.id}">{:lang('currency')['edit']}</a> <a class="button border-red button-little" href="article/del.html?id={$article.id}&page={:input('get.page')}" onclick="if(confirm('{:lang('currency')['del']}?')){return true;}return false;">{:lang('currency')['del']}</a></td>
			</tr>
			{/volist}
		</table>
		{include file="public/pages" /}
	</div>
</form>
<script>

$('#select_del').click(function(){
	var str="";
	$("input:checkbox[name=id]:checked").each(function(){
		str+=$(this).val()+",";
	});
	if(str!=''){
		if(confirm('{:lang('currency')['del']}?')){location.href='article/del.html?id='+str;}
	}
});
$('.editcat').on('click',function (){
	var id = $(this).attr('data-id');
	layer.open({
		type:2,
		title:false,
		area: ['50%', '70%'],
		content: "__ROOT__/admin/article/category"
	});
});
</script>
{include file="public/footer" /}